import com.cyberbotics.webots.controller.DifferentialWheels;

/**
 * 
 * @author meranermarcel
 *
 *         Abstrakter Controller beinhaltet Informationen und Methoden die von
 *         den anderen Controllern benötigt werden.
 */

public abstract class AbstractAgent extends DifferentialWheels implements BehaviorAgent {

	protected static final int TIME_STEP = 16; 

	protected static final int MIN_SPEED = 0; 
	protected static final int MAX_SPEED = 1000; 
	

	/**
	 * Robot dreht um die eigene Achse
	 */
	protected void rotateAxis() {
		setSpeed(-MAX_SPEED, MAX_SPEED);
	}
	/**
	 * Robot turns right
	 */
	protected void driveRight() {
		setSpeed(MAX_SPEED, MIN_SPEED);
	}

	/**
	 * Robot turn left
	 */
	protected void driveLeft() {
		setSpeed(MIN_SPEED, MAX_SPEED);
	}

	/**
	 * Robot drives forward
	 */
	protected void driveForward() {
		setSpeed(MAX_SPEED, MAX_SPEED);
	}

	/**
	 * Robot stops driving
	 */
	protected void stopDriving() {
		setSpeed(MIN_SPEED, MIN_SPEED);
	}

	/**
	 * @param left
	 *            speed
	 * @param right
	 *            speed
	 */
	protected void driveWithSpeed(int left, int right) {
		setSpeed(left, right);
	}
	
	/**
	 * 
	 * @param speed which the robot should drive
	 */
	protected void driveWithSpeed(Speed speed) {
		setSpeed(speed.getLeft(), speed.getRight());
	}

}
